import {
  FormItemType,
  DictionaryType,
  ParamsType,
  TableKeyListItemType,
  BatchBtnItemType,
} from "@/common/types/conf";

// 筛选字段
export const form: Array<FormItemType> = [
  {
    type: "input",
    tip: "试题ID",
    searchKey: "questionCode",
  },
  {
    type: "input",
    tip: "试题关键字",
    searchKey: "stemTextFuzzy",
  },
  {
    type: "select",
    tip: "题型",
    searchKey: "type",
  },
  {
    type: "select",
    tip: "归属",
    searchKey: "ownerType",
  },
  {
    type: "select",
    tip: "科目",
    searchKey: "subjectId",
  },
  {
    type: "select",
    tip: "试题状态",
    searchKey: "isEnabled",
  },
];

// 筛选条件
export const params: ParamsType = {
  questionCode: "",
  stemTextFuzzy: "",
  type: "",
  subjectId: "",
  ownerType: "", // 1品牌  2分公司
  isEnabled: "",
  brandId: "",
  branchId: "",
  roleType: 1, // 1品牌  2分公司
};

// 筛选下拉表单 value value
export const dictionary: DictionaryType = {
  ownerType: [
    { value: 1, label: "品牌" },
    { value: 2, label: "分公司" },
  ],
  type: [
    { value: 1, label: "单选" },
    { value: 2, label: "多选" },
    { value: 3, label: "判断" },
  ],
  isEnabled: [
    { value: 0, label: "禁用" },
    { value: 1, label: "启用" },
  ],
  visable: [
    { value: 0, label: "未公开" },
    { value: 1, label: "公开" },
  ],
};

// 列表 value name
export const tableKeyList: Array<TableKeyListItemType> = [
  {
    key: "questionCode",
    label: "ID",
  },
  {
    key: "type",
    label: "题型",
  },
  {
    key: "subjectTitle",
    label: "科目",
  },
  {
    key: "stemText",
    label: "题干",
    width: 300,
  },
  {
    key: "ownerType",
    label: "归属",
  },
  {
    key: "isEnabled",
    label: "状态",
  },
];

export const batchBtnList: Array<BatchBtnItemType> = [
  {
    name: "删除",
    status: -1,
    btnType: "warning",
    enabledKey: "isEnabled",
    enableValue: 0,
  },
  {
    name: "禁用",
    status: 0,
    btnType: "warning",
    enabledKey: "isEnabled",
    enableValue: 1,
  },
  {
    name: "启用",
    status: 1,
    btnType: "primary",
    enabledKey: "isEnabled",
    enableValue: 0,
  },
];
